package com.ok.apm.crash

import com.ok.apm.core.IPlugin
import com.ok.apm.core.IPluginConfig
import com.ok.apm.core.IReport

class CrashPlugin() : IPlugin<CrashPluginConfig>(),IReport {
    var crashService: CrashService? = null

    override fun start() {
        crashService = CrashServiceImpl2()
        crashService?.start()
    }

    override fun onMessageReport(message: (String) -> Unit) {

    }
}

class CrashPluginConfig : IPluginConfig


inline fun crashPlugin(create: CrashPlugin.() -> Unit): CrashPlugin {
    val crashPlugin = CrashPlugin()
    create(crashPlugin)
    return crashPlugin
}

inline fun crashPluginConfig(create: CrashPluginConfig.() -> Unit): CrashPluginConfig {
    val crashPluginConfig = CrashPluginConfig()
    create(crashPluginConfig)
    return crashPluginConfig
}
